REM "%~1" == "$(UserDataPath)"
REM "%~2" == "$(GameDediServerPath)"
REM "%~3" == "$(TargetPath)"
REM "%~4" == "$(ModName)"
REM "%~5" == "$(AssemblyName)"

if "%~1" == "" goto dedi_copy

REM set p=%~1\mods\%~4
set p=%~1\BepInEx\plugins\%~4
if not exist "%p%" md "%p%" && echo md %p%
echo | set /p="%~5.dll -> %p%\%~5.dll"
robocopy "%~3" "%p%" "%~5.dll" /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
echo | set /p=copy info...
robocopy "..\..\.." "%p%" "%~5.info" /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
REM echo | set /p=copy about...
REM robocopy "..\..\..\About" "%p%\About" /E /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
echo | set /p=copy lang...
robocopy "..\..\..\Localization" "%p%\Localization" "*.xml" /E /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
echo | set /p=copy data...
robocopy "..\..\..\Language" "%p%\Language" /E /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP

:dedi_copy
if "%~2" == "" exit /B 0
set p=%~2\BepInEx\plugins\%~4
if not exist "%p%" md "%p%" && echo md "%p"
echo | set /p="%~5.dll -> %p%\%~5.dll"
robocopy "%~3" "%p%" "%~5.dll" /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
echo | set /p=copy lang...
robocopy "..\..\..\Localization" "%p%\Localization" "*.xml" /E /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
echo | set /p=copy data...
robocopy "..\..\..\Language" "%p%\Language" /E /COPYALL /DCOPY:T /R:0 /NFL /NDL /NJH /NJS /NP
exit /B 0
